package models;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;

import play.data.validation.MaxSize;
import play.db.jpa.Model;

@Entity
public class MBao extends Model {
	
	@Column(unique=true)
	public String title;
	
	public String picUrl;
	
	@Lob
	@MaxSize(10000)
	public String introduce;
	
	@Lob
	@MaxSize(10000)
	public String description;
	
	public String link;
	
	public double price;

	public double score;
	
	public Date publishDate;
	
	public Date outDate;
	
	
	
	public String toString(){
		return title;
	}
	
	public static boolean valid(MBao bao){
		if(null == bao ||
				bao.title == null || "".equals(bao.title)){
			return false;
		}
		return true;
	}
}
